<div class="form">

<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'slides-form',
	'enableAjaxValidation'=>false,
//        'enableClientValidation' => true,
//        'clientOptions' => array(
//            'validateOnSubmit' => true,
//        ),
      'htmlOptions' => array('enctype' => 'multipart/form-data')
)); ?>
	 <div class="row buttons" align="right">
		<?php echo CHtml::submitButton($model->isNewRecord ? 'Create' : 'Save'); ?>
	</div>

	<p class="note">Fields with <span class="required">*</span> are required.</p>


	<?php echo $form->errorSummary($model); ?>

	<div class="row">
		<?php echo $form->labelEx($model,'title'); ?>
		<?php echo $form->textField($model,'title',array('size'=>60,'maxlength'=>255)); ?>
		<?php echo $form->error($model,'title'); ?>
	</div>
	<div class="row">
		<?php echo $form->labelEx($model,'image'); ?>
		<?php echo $form->fileField($model,'image',array()); ?>
		<?php echo $form->error($model,'image'); ?>
	</div>
	<div class="row">
		<?php echo $form->labelEx($model,'description'); ?>
                <?php
                    $this->widget('application.extensions.tinymce.ETinyMce', array(
                        'id' 		=> 'Slides_description',
                        'name' 		=> 'Slides[description]',
                        'model' 	=> $model,
                        'options' 	=> array(
                            'theme' 							=> 'advanced',
                            'theme_advanced_toolbar_location' 	=> 'top',
                            'theme_advanced_buttons1' 			=> 'newdocument,|,bold,italic,underline,|,justifyleft,justifycenter,justifyright,fontselect,fontsizeselect,formatselect',
                            'theme_advanced_buttons2' 			=> 'cut,copy,paste,|,bullist,numlist,|,outdent,indent,|,undo,redo,|,link,unlink,anchor,image,|,code,preview,|,forecolor,backcolor',
                            'theme_advanced_buttons3' 			=> '',
                            'theme_advanced_toolbar_align' 		=> 'left'
                        ),
                        'value' => $model->description
                    ));
                ?>
		<?php echo $form->error($model,'description'); ?>
	</div>
	<div class="row">
		<?php echo $form->labelEx($model,'position'); ?>
		<?php echo $form->textField($model,'position', array('value' => 0)); ?>
		<?php echo $form->error($model,'position'); ?>
	</div>
	<div class="row">
		<?php echo $form->labelEx($model,'status'); ?>
		<?php echo $form->dropDownList($model,'status', Util::$arrayActive); ?>
		<?php echo $form->error($model,'status'); ?>
	</div>

        <?php if (!$model->isNewRecord): ?>
            <input type="hidden" name="update_id" value="<?php echo $model->id; ?>"/>
        <?php endif; ?>

	<div class="row buttons" align="right">
		<?php echo CHtml::submitButton($model->isNewRecord ? 'Create' : 'Save'); ?>
	</div>

<?php $this->endWidget(); ?>

</div><!-- form -->